package com.niit.dao

import com.niit.utils.JDBCUtil

class AreaCountDao {

  def inserAreaCount(day:String,area:String,city:String,adid:String,count:Int): Unit ={
    val conn = JDBCUtil.getConnection

    JDBCUtil.executeUpdate(conn,
      """
        |insert into area_city_ad_count(dt,area,city,adid,count)
        |values (?,?,?,?,?)
        |on duplicate key update count = count + ?
        |
        |""".stripMargin,Array(day,area,city,adid,count,count))

    conn.close()
  }
}
